<!DOCTYPE HTML>
<html lang="en" >
    <!-- Start book Python数据分析课程讲义 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>二、科学计算工具NumPy | Python数据分析课程讲义</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        <meta name="author" content="BigCat">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-tbfed-pagefooter/footer.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../file/part02/2.1.html" />
    
    
    <link rel="prev" href="../../file/part01/1.3.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="2"
        data-chapter-title="二、科学计算工具NumPy"
        data-filepath="file/part02/2.md"
        data-basepath="../.."
        data-revision="Thu Apr 27 2017 00:50:19 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        传智播客Python学院数据分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="file/part01/1.html">
            
                
                    <a href="../../file/part01/1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        一、工作环境准备及数据分析建模理论基础
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="file/part01/1.1.html">
            
                
                    <a href="../../file/part01/1.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        Python 3.x新特性和编码回顾
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="file/part01/1.2.html">
            
                
                    <a href="../../file/part01/1.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        DIKW模型与数据工程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="file/part01/1.3.html">
            
                
                    <a href="../../file/part01/1.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        数据分析建模理论基础
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="2" data-path="file/part02/2.html">
            
                
                    <a href="../../file/part02/2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        二、科学计算工具NumPy
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="file/part02/2.1.html">
            
                
                    <a href="../../file/part02/2.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        ndarray的创建与数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="file/part02/2.2.html">
            
                
                    <a href="../../file/part02/2.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        ndarray的矩阵处理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="file/part02/2.3.html">
            
                
                    <a href="../../file/part02/2.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        ndarray的元素处理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="file/part02/2.4.html">
            
                
                    <a href="../../file/part02/2.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        实战案例：2016美国总统大选民意调查统计
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="file/part03/3.html">
            
                
                    <a href="../../file/part03/3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        三、数据分析工具Pandas
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="file/part03/3.1.html">
            
                
                    <a href="../../file/part03/3.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        Pandas的数据结构
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="file/part03/3.2.html">
            
                
                    <a href="../../file/part03/3.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        Pandas的索引操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="file/part03/3.3.html">
            
                
                    <a href="../../file/part03/3.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        Pandas的对齐运算
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="file/part03/3.4.html">
            
                
                    <a href="../../file/part03/3.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        Pandas的函数应用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="file/part03/3.5.html">
            
                
                    <a href="../../file/part03/3.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        Pandas的层级索引
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="file/part03/3.6.html">
            
                
                    <a href="../../file/part03/3.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        Pandas统计计算和描述
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="file/part03/3.7.html">
            
                
                    <a href="../../file/part03/3.7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        Pandas分组与聚合
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="file/part03/3.8.html">
            
                
                    <a href="../../file/part03/3.8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        数据清洗、合并、转化和重构
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="file/part03/3.9.html">
            
                
                    <a href="../../file/part03/3.9.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        聚类模型 -- K-Means介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="file/part03/3.10.html">
            
                
                    <a href="../../file/part03/3.10.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        实战案例：全球食品数据分析
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="file/part04/4.html">
            
                
                    <a href="../../file/part04/4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        四、数据可视化工具
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="file/part04/4.1.html">
            
                
                    <a href="../../file/part04/4.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        Matplotlib绘图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="file/part04/4.2.html">
            
                
                    <a href="../../file/part04/4.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        Seaborn绘图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="file/part04/4.3.html">
            
                
                    <a href="../../file/part04/4.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        Bokeh绘图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="file/part04/4.4.html">
            
                
                    <a href="../../file/part04/4.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        实战案例：世界高峰数据可视化
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="file/part06/6.html">
            
                
                    <a href="../../file/part06/6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        五、自然语言处理NLTK
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="file/part06/6.1.html">
            
                
                    <a href="../../file/part06/6.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        NLTK与自然语言处理基础
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="file/part06/6.2.html">
            
                
                    <a href="../../file/part06/6.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        jieba分词
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="file/part06/6.3.html">
            
                
                    <a href="../../file/part06/6.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        情感分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="file/part06/6.4.html">
            
                
                    <a href="../../file/part06/6.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        文本相似度和分类
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="file/part06/6.6.html">
            
                
                    <a href="../../file/part06/6.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        实战案例：微博情感分析
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >Python数据分析课程讲义</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <blockquote>
<h2 id="numpy&#xFF08;numerical-python&#xFF09;">Numpy&#xFF08;Numerical Python&#xFF09;</h2>
</blockquote>
<p>Numpy&#xFF1A;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x5728;Python&#x4E2D;&#x505A;&#x79D1;&#x5B66;&#x8BA1;&#x7B97;&#x7684;&#x57FA;&#x7840;&#x5E93;&#xFF0C;&#x91CD;&#x5728;&#x6570;&#x503C;&#x8BA1;&#x7B97;&#xFF0C;&#x4E3B;&#x8981;&#x7528;&#x4E8E;&#x591A;&#x7EF4;&#x6570;&#x7EC4;&#xFF08;&#x77E9;&#x9635;&#xFF09;&#x5904;&#x7406;&#x7684;&#x5E93;&#x3002;&#x7528;&#x6765;&#x5B58;&#x50A8;&#x548C;&#x5904;&#x7406;&#x5927;&#x578B;&#x77E9;&#x9635;&#xFF0C;&#x6BD4;Python&#x81EA;&#x8EAB;&#x7684;&#x5D4C;&#x5957;&#x5217;&#x8868;&#x7ED3;&#x6784;&#x8981;&#x9AD8;&#x6548;&#x7684;&#x591A;&#x3002;&#x672C;&#x8EAB;&#x662F;&#x7531;C&#x8BED;&#x8A00;&#x5F00;&#x53D1;&#xFF0C;&#x662F;&#x4E2A;&#x5F88;&#x57FA;&#x7840;&#x7684;&#x6269;&#x5C55;&#xFF0C;Python&#x5176;&#x4F59;&#x7684;&#x79D1;&#x5B66;&#x8BA1;&#x7B97;&#x6269;&#x5C55;&#x5927;&#x90E8;&#x5206;&#x90FD;&#x662F;&#x4EE5;&#x6B64;&#x4E3A;&#x57FA;&#x7840;&#x3002;</p>
<ul>
<li><p>&#x9AD8;&#x6027;&#x80FD;&#x79D1;&#x5B66;&#x8BA1;&#x7B97;&#x548C;&#x6570;&#x636E;&#x5206;&#x6790;&#x7684;&#x57FA;&#x7840;&#x5305;</p>
</li>
<li><p>ndarray&#xFF0C;&#x591A;&#x7EF4;&#x6570;&#x7EC4;&#xFF08;&#x77E9;&#x9635;&#xFF09;&#xFF0C;&#x5177;&#x6709;&#x77E2;&#x91CF;&#x8FD0;&#x7B97;&#x80FD;&#x529B;&#xFF0C;&#x5FEB;&#x901F;&#x3001;&#x8282;&#x7701;&#x7A7A;&#x95F4;</p>
</li>
<li><p>&#x77E9;&#x9635;&#x8FD0;&#x7B97;&#xFF0C;&#x65E0;&#x9700;&#x5FAA;&#x73AF;&#xFF0C;&#x53EF;&#x5B8C;&#x6210;&#x7C7B;&#x4F3C;Matlab&#x4E2D;&#x7684;&#x77E2;&#x91CF;&#x8FD0;&#x7B97;</p>
</li>
<li><p>&#x7EBF;&#x6027;&#x4EE3;&#x6570;&#x3001;&#x968F;&#x673A;&#x6570;&#x751F;&#x6210;</p>
</li>
<li><p><code>import numpy as np</code></p>
</li>
</ul>
<blockquote>
<h2 id="scipy">Scipy</h2>
</blockquote>
<p>Scipy &#xFF1A;&#x57FA;&#x4E8E;Numpy&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x5728;Python&#x4E2D;&#x505A;&#x79D1;&#x5B66;&#x8BA1;&#x7B97;&#x7684;&#x5DE5;&#x5177;&#x96C6;&#xFF0C;&#x4E13;&#x4E3A;&#x79D1;&#x5B66;&#x548C;&#x5DE5;&#x7A0B;&#x8BBE;&#x8BA1;&#x7684;Python&#x5DE5;&#x5177;&#x5305;&#x3002;&#x4E3B;&#x8981;&#x5E94;&#x7528;&#x4E8E;&#x7EDF;&#x8BA1;&#x3001;&#x4F18;&#x5316;&#x3001;&#x6574;&#x5408;&#x3001;&#x7EBF;&#x6027;&#x4EE3;&#x6570;&#x6A21;&#x5757;&#x3001;&#x5085;&#x91CC;&#x53F6;&#x53D8;&#x6362;&#x3001;&#x4FE1;&#x53F7;&#x548C;&#x56FE;&#x50CF;&#x5904;&#x7406;&#x3001;&#x5E38;&#x5FAE;&#x5206;&#x65B9;&#x7A0B;&#x6C42;&#x89E3;&#x3001;&#x7A00;&#x758F;&#x77E9;&#x9635;&#x7B49;&#xFF0C;&#x5728;&#x6570;&#x5B66;&#x7CFB;&#x6216;&#x8005;&#x5DE5;&#x7A0B;&#x7CFB;&#x76F8;&#x5BF9;&#x7528;&#x7684;&#x591A;&#x4E00;&#x4E9B;&#xFF0C;&#x548C;&#x6570;&#x636E;&#x5904;&#x7406;&#x7684;&#x5173;&#x7CFB;&#x4E0D;&#x5927;&#xFF0C; <strong>&#x6211;&#x4EEC;&#x77E5;&#x9053;&#x5373;&#x53EF;&#xFF0C;&#x8FD9;&#x91CC;&#x4E0D;&#x505A;&#x8BB2;&#x89E3;&#x3002;</strong></p>
<ul>
<li><p>&#x5728;NumPy&#x5E93;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x589E;&#x52A0;&#x4E86;&#x4F17;&#x591A;&#x7684;&#x6570;&#x5B66;&#x3001;&#x79D1;&#x5B66;&#x53CA;&#x5DE5;&#x7A0B;&#x5E38;&#x7528;&#x7684;&#x5E93;&#x51FD;&#x6570;</p>
</li>
<li><p>&#x7EBF;&#x6027;&#x4EE3;&#x6570;&#x3001;&#x5E38;&#x5FAE;&#x5206;&#x65B9;&#x7A0B;&#x6C42;&#x89E3;&#x3001;&#x4FE1;&#x53F7;&#x5904;&#x7406;&#x3001;&#x56FE;&#x50CF;&#x5904;&#x7406;</p>
</li>
<li><p>&#x4E00;&#x822C;&#x7684;&#x6570;&#x636E;&#x5904;&#x7406;numpy&#x5DF2;&#x7ECF;&#x591F;&#x7528;</p>
</li>
<li><p><code>import scipy as sp</code></p>
</li>
</ul>
<h2 id="&#x53C2;&#x8003;&#x5B66;&#x4E60;&#x8D44;&#x6599;&#xFF1A;">&#x53C2;&#x8003;&#x5B66;&#x4E60;&#x8D44;&#x6599;&#xFF1A;</h2>
<p>Python&#x3001;NumPy&#x548C;SciPy&#x4ECB;&#x7ECD;&#xFF1A;<a href="http://cs231n.github.io/python-numpy-tutorial" target="_blank">http://cs231n.github.io/python-numpy-tutorial</a></p>
<p>NumPy&#x548C;SciPy&#x5FEB;&#x901F;&#x5165;&#x95E8;&#xFF1A;<a href="https://docs.scipy.org/doc/numpy-dev/user/quickstart.html" target="_blank">https://docs.scipy.org/doc/numpy-dev/user/quickstart.html</a> </p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; BigCat all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x300C;Revision Time:
2017-03-12 22:16:30&#x300D;
</span></footer>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../file/part01/1.3.html" class="navigation navigation-prev " aria-label="Previous page: 数据分析建模理论基础"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../file/part02/2.1.html" class="navigation navigation-next " aria-label="Next page: ndarray的创建与数据类型"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"disqus":{"shortName":"gitbookuse"},"github":{"url":"https://github.com/dododream"},"search-pro":{"cutWordLib":"nodejieba","defineWord":["gitbook-use"]},"sharing":{"weibo":true,"facebook":true,"twitter":true,"google":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"tbfed-pagefooter":{"copyright":"Copyright © BigCat","modify_label":"「Revision Time:","modify_format":"YYYY-MM-DD HH:mm:ss」"},"baidu":{"token":"ff100361cdce95dd4c8fb96b4009f7bc"},"sitemap":{"hostname":"http://www.treenewbee.top"},"donate":{"wechat":"http://weixin.png","alipay":"http://alipay.png","title":"","button":"赏","alipayText":"支付宝打赏","wechatText":"微信打赏"},"edit-link":{"base":"https://github.com/dododream/edit","label":"Edit This Page"},"splitter":{},"toggle-chapters":{},"highlight":{},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book Python数据分析课程讲义 -->
</html>
